constint NMAX = 5e04, ABMAX = 200; LL S[MAXN][MAXAB]= {0}; LL fact[MAXAB]= {0}, invfact[MAXAB]= {0}; voidinit(){ S[0][0] = 1; for (int i = 1; i <= NMAX; i ++) for (int j = 1; j <= min (i, ABMAX); j ++) S[i][j] = (S[i - 1][j - 1] + S[i - 1][j] * (i - 1) % MOD) % MOD; fact[0] = fact[1] = invfact[0] = invfact[1] = 1; for (int i = 2; i <= ABMAX; i ++) { fact[i] = fact[i - 1] * i % MOD; invfact[i] = (MOD - MOD / i) * invfact[MOD % i] % MOD; } for (int i = 1; i <= ABMAX; i ++) invfact[i] = invfact[i - 1] * invfact[i] % MOD; } inline LL C(int n, int m){ return fact[n] * invfact[m] % MOD * invfact[n - m] % MOD; }
inlineintgetnum(){ int num = 0; char ch = getchar (); while (! isdigit (ch)) ch = getchar (); while (isdigit (ch)) num = (num << 3) + (num << 1) + ch - '0', ch = getchar (); return num; } inlinevoidwrite(LL x){ if (x >= 10) write (x / 10); putchar (x % 10 + '0'); }
intmain(){ init (); T = getnum (); for (int Case = 1; Case <= T; Case ++) { n = getnum (), A = getnum (), B = getnum (); LL ans = S[n - 1][A + B - 2] * C (A + B - 2, A - 1) % MOD; write (ans), puts (""); }